home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / alarm.c < prev    next >
C/C++ Source or Header  |  1990-09-16  |  310b  |  27 lines

  1. /*
  2.  * alarm: a public domain alarm for MiNT (by ers)
  3.  */
  4.  
  5. #include <errno.h>
  6. #include <mintbind.h>
  7.  
  8. extern int __mint;
  9.  
  10. int
  11. alarm(secs)
  12.     unsigned secs;
  13. {
  14.     long r;
  15.  
  16.     if (__mint == 0)
  17.         r = -EINVAL;
  18.     else
  19.         r = Talarm((long)secs);
  20.  
  21.     if (r < 0) {
  22.         errno = -r;
  23.         r = -1;
  24.     }
  25.     return r;
  26. }
  27.